/*
 * NeighList.h
 *
 *  Created on: Aug 9, 2011
 *      Author: marchi
 */

#ifndef NEIGHLIST_H_
#define NEIGHLIST_H_
#include <list>
using std::list;

struct NonSortable{
	int n;
};
struct Sortable{
	int n;
	float dist;
};

template <typename T>
class NeighList {
protected:
	list<T> neigh;
public:
	NeighList(){};
	virtual ~NeighList(){neigh.clear();};
	void push_back(const float &, const int &);
	void push_back(const int &);
	void push_front(const float &, const int &);
	void push_front(const int &);
	void sort();
	void resize(int n){neigh.resize(n);}
	typedef typename list<T>::iterator iterator;
	const iterator begin(){return neigh.begin();};
	const iterator end(){return neigh.end();};

private:
	static bool compare(T &, T &);
};

#endif /* NEIGHLIST_H_ */
